package com.springboot.model.validator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @Author: TongRui乀
 * @Date: 2020-04-13 10:21
 * @description：
 */
public class IdCardValidator implements ConstraintValidator<IdCard, Object> {
    @Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {
        return value.toString().length() == 18;
    }
}
